﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<title>sample8</title>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
		<script type="text/javascript">
$(function(){
	$("form").submit(function(){
		if($("input[name='name']").val()==""){
			if($("span").css("color") != "red"){
				$("input[name='name']").css("border","1px solid red").after("<span>이름을 입력해 주세요</span>");
				$("span").css("color","red");
			}
			return false;
		}
	});
});
		</script>
	</head>
	<body>
	<form action="check.html" method="post">
		<dl>
		<dt> 이름<em>(필수)</em></dt>
		<dd><input type="text" name="name" /></dd>

		<dt> 성별</dt>
		<dd>
		<input type="radio" name="gender" value=" 남성"id="gender_man" />
		<label for="gender_man"> 남성</label>
		<input type="radio" name="gender" value=" 여성"id="gender_woman" />
		<label for="gender_woman"> 여성</label>
		</dd>
	
		<dt> 연령</dt>
		<dd>
		<select name="age">
		<option> 선택해주세요</option>
		<option value="10대">10대</option>
		<option value="20대">20대</option>
		<option value="30대">30대</option>
		<option value="40대이상">40대이상</option>
		</select>
		</dd>

		<dt> 스킬</dt>
		<dd>
		<input type="checkbox" name="xhtml" value="XHTML" id="xhtml" />
		<label for="xhtml">XHTML</label>
		<input type="checkbox" name="css" value="CSS" id="css" />
		<label for="css">CSS</label>
		<input type="checkbox" name="javascript" value="JavaScript" id="javascript" />
		<label for="javascript">JavaScript</label>
		<input type="checkbox" name="php" value="PHP" id="php" />
		<label for="php">PHP</label>
		</dd>	

		<dt> 코멘트</dt>
		<dd>
		<textarea name="comment"></textarea>
		</dd>
		<input type="submit" value=" 전송" />
		</dl>
	</form>
	</body>
</html>